<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%-- 
    JSP Name : jspName.jsp
    Description : 설명을 기술합니다.
    author ETLee
    since 2012. 6. 28.
    version 1.0
    Modification Information
       since          author              description
    ===========    =============    ===========================
    2012. 6. 28.     ETLee     최초 생성
--%>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>
<style type="text/css">
/* body {padding:0;} */
/* #centersearch2 {display:block; position:static; margin:0;} */
</style>
<script type="text/javascript">    
    function fnSelectIndex(){
        var areaId = $('#wpaList option:selected').val();
        var param = 'areaId='+ areaId;
        $.ajax({
            type:'POST',
            url:'/kr/tda/selectCtrSelectBoxList.do',
            data:param,
            dataType:'html',
            cache:false,
            error:function(){
               alert("팝업의 데이터를 가져오지 못하였습니다."); 
            },
            success:function ( html, status ){
                $('#ctrSelectArea').html($.trim(html));
                //checkPopup();
            }
        });
    }
    
    function fnCtrView(){
        var ctrCd = $('#ctrList option:selected').val();
        if(ctrCd == ''){
            alert("시승 센터를 선택하세요");
            return;
        }
        var param = "ctrCd="+ ctrCd;
        $.ajax({
            type:'POST',
            url:'/kr/tda/selectCtrViewDtl.do',
            data:param,
            dataType:'html',
            cache:false,
            error:function(){
               alert("팝업의 데이터를 가져오지 못하였습니다."); 
            },
            success:function ( html, status ){
                $('#centerContent').html(html);
                //checkPopup();
            }
        });
    }
</script>
<!-- 시승센터 안내 -->
<div id="centersearch2" class="layerpopup centersearch" style="top: 250px; display: block; "><div class="layerpopup-inner">
    <div class="layerpopup-head">
        <h1><img src="/kr/images/layerpopup/h1_center_search02.gif" alt="시승센터 안내" /></h1>
    </div>
    <div class="layerpopup-contents">
        <div class="centersearch-wrap">
            <div class="list-search-form02">
                <select id="wpaList" class="select1 select-type1" style="width: 230px;" onchange="fnSelectIndex();">
                <!--                 <select style="width:230px;" id="wpaList" onchange="fnSelectIndex();"> -->
                    <option>지역선택</option>
                    <option value="1">서울</option>
                    <option value="11">부산</option>
                    <option value="6">인천</option>
                    <option value="15">대구</option>
                    <option value="12">울산</option>
                    <option value="3">대전</option>
                    <option value="8">광주</option>
                    <option value="2">강원</option>
                    <option value="7">경기</option>
                    <option value="16">경북</option>
                    <option value="13">경남</option>
                    <option value="4">충북</option>
                    <option value="5">충남</option>
                    <option value="9">전북</option>
                    <option value="10">전남</option>
                </select>
                <span id="ctrSelectArea">
<!--                 <select class="select1 select-type2" style="width:230px;"> -->
                <select class="select1 select-type1" style="width:230px;" id="ctrList">
                    <option value="">센터명 선택</option>
                </select>
                </span>
                <a href="javascript:fnCtrView();"><img src="/kr/images/common/button/btn_search03.gif" alt="SEARCH" /></a>
            </div>
            <div id="centerContent">
            </div>
        </div>
    </div>
    <!-- close -->
    <div class="close-area"><div class="close-area-inner">
        <img src="/kr/images/layerpopup/btn_close.gif" alt="닫기" class="close" />
    </div></div>
    <!-- //close -->
</div></div>
<!-- //시승센터 안내 -->
<script>
    $('select.select1').customSelect();
</script>
